package com.munhrasoft.dinamica.business.entities;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;

@Entity
@NamedQueries(value = {
		@NamedQuery(name = "findAllCorretores", query = "SELECT corr FROM Corretor corr"),
		@NamedQuery(name = "findCorretorByNome", query = "SELECT corr FROM Corretor corr WHERE lower(corr.nome) "
				+ "LIKE :nome") })
@SequenceGenerator(name = "corretorSeq", initialValue = 1, allocationSize = 1)
public class Corretor {

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "corretorSeq")
	private Long corretor_id;
	private String nome;
	private String email;
	private String tel;
	private String telImobiliaria;
	private String imobiliaria;

	@Override
	public boolean equals(Object obj) {
		if (this.getCorretor_id() == ((Corretor) obj).getCorretor_id()) {
			return true;
		} else {
			return false;
		}
	}

	public Long getCorretor_id() {
		return corretor_id;
	}

	public void setCorretor_id(Long corretor_id) {
		this.corretor_id = corretor_id;
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public String getTelImobiliaria() {
		return telImobiliaria;
	}

	public void setTelImobiliaria(String telImobiliaria) {
		this.telImobiliaria = telImobiliaria;
	}

	public String getImobiliaria() {
		return imobiliaria;
	}

	public void setImobiliaria(String imobiliaria) {
		this.imobiliaria = imobiliaria;
	}

}
